/**
 * Created by Administrator on 2017/3/25.
 */
var MyComponment = React.createClass({
    getDefaultProps:function () {
        //only once  组件调用一次
        console.log("getDefaultProps");
        return {username:"zhangsan"};
    },
    //组件实例调用一次
    getInitialState:function () {

        console.log("getInitialState");
        return {count:0};
    },
    //完成首次渲染之前调用
    componentWillMount:function () {
        console.log("componentWillMount")
    },

    render:function () {
        console.log("render");
        return <div>
            hello  lifestle  {this.props.username}
        </div>
    },

    componentDidMount:function () {
        console.log("componentDidMount");
    },

    componentWillReceiveProps:function () {
        console.log("componentWillReceiveProps");

    },

    componentWillUpdate:function () {
        console.log("componentWillUpdate");

    },

    componentDidUpdate:function () {
        console.log("componentDidUpdate");

    },

    componentWillUnmount:function () {
        console.log("componentWillUnmount");

    }

});

ReactDOM.render(<MyComponment username="xiao hong "></MyComponment>,document.body);